import java.util.Observable;

public class Player extends Observable {
	
	private String playerName; 
	private int currentMoney, lastRoll, doubleRollCount, chanceJailToken, communityJailToken, highRoll, queueSpot, componentPointer,
				jailCounter;
	

	private Block currentBlockPos, nextBlockPos;
	private boolean active;
	private String playerToken;
	//private int jailTokens;
		
	//Block currentBlockPosition;
/***Load game Constructor***/
	
	public Player(String name){
		
		playerName = name;
	
	}
/** SinglePlayerConstructor **/
	public Player(){
		
		this.playerName = "Tester";
		this.currentMoney = 500;
		//this.jailTokens = 1;
		this.highRoll = 12;
		this.queueSpot = 0;
		this.active = true;
		this.playerToken = "Graphics/4.png";
		this.currentBlockPos = null;
		this.nextBlockPos = null;
		
	}
	
/***Real Loaded Constructor***/	
	
	public Player(String name, String token, int componentPointer){
		this.playerName=name; 
		this.playerToken = token;
		this.componentPointer = componentPointer;
		this.setStartingMoney(); 
		this.currentBlockPos=null;
		this.nextBlockPos=null;
		//this.jailTokens=0;
		this.chanceJailToken=0;
		this.communityJailToken=0;
		this.setDoubleRollCount(0);
		this.active = true;
		this.jailCounter = 0;
		
	}
	
/***Setters***/
	
	public void setCurrentMoney(int currentMoney) {
		this.currentMoney = currentMoney;
	}
	
	public void setJailCounter(int jailCntr){
		this.jailCounter = jailCntr;
	}
	
	public void setComponentPointer(int componentPointer) {
		this.componentPointer = componentPointer;
	}
	
	public void setQueueSpot(int queueSpot) {
		this.queueSpot = queueSpot;
	}
	
	public void setPlayerToken(String playerToken) {
		this.playerToken = playerToken;
	}
	
	public void setLastRoll(int roll){
		this.lastRoll = roll;
	}
	
	public void setChanceJailToken(int chanceToken){
		this.chanceJailToken = chanceToken;
	}
	
	public void setCommunityJailToken(int communityToken){
		this.communityJailToken = communityToken;
	}
	
	/*public void setJailTokens(){
		this.jailTokens = chanceJailToken + communityJailToken;
	}*/
	
	public void setCurrentBlockPos(Block bl){
		this.currentBlockPos=bl;
	}
	
	public void setNextBlockPos(Block bl){
		this.nextBlockPos=bl;
	}
	
	public void setActive(boolean active){
		this.active=active;
	}
	
	public void setDoubleRollCount(int doubleRollCount) {
		this.doubleRollCount = doubleRollCount;
	}
	
	
	public void setHighRoll(int roll){
		this.highRoll = roll;
	}
	
	public void setPlayerName(String playerName){
		this.playerName = playerName;
	}

	/*public void setCurrentBlockPosition(int cBlockPos){
		this.currentBlockPosition = cBlockPos;
	}*/
	
	
/***Getters***/	
	public int getComponentPointer() {
		return componentPointer;
	}
	
	public int getJailCounter(){
		return jailCounter;
	}
	
	public int getQueueSpot(){
		return queueSpot;
	}
	
	public String getPlayerName(){
		return playerName;
	}
	
	public int getCurrentMoney(){
		return currentMoney;
	}
	
	public int getLastRoll(){
		return lastRoll;
	}
	
	public String getPlayerToken(){
		return playerToken;
	}
	
	public Block getCurrentBlockPos(){
		return currentBlockPos;
	}
	
	public boolean getActive(){
		return active;
	}

	public int getDoubleRollCount() {
		return doubleRollCount;
	}
	
	public int getChanceJailToken(){
		return chanceJailToken;
	}
	
	public int getCommunityJailToken(){
		return communityJailToken;
	}
	
	/*public int getJailTokens(){
		return jailTokens;
	}*/
	
	
	public int getHighRoll(){
		return this.highRoll;
	}
	
	/*public int getNextBlockPosition(){
		return nextBlockPosition;
	}*/
	
	/*public int getCurrentBlockPosition(){
		return currentBlockPosition;
	}*/

	public Block getNextBlockPos(){
		return nextBlockPos;
	}
	
	
	
/***Extra Methods***/
	
	public void setStartingMoney(){
		currentMoney = 1500;
	}
	
	public void addMoney(int add){
		currentMoney=currentMoney + add;
		setChanged();
		notifyObservers(currentMoney);
	}
	
	public void subtractMoney(int sub){
		currentMoney=currentMoney - sub;
		setChanged();
		notifyObservers(currentMoney);
	}
	
	/*public void setIsFuckedUp(boolean fuck){
		this.isFuckedUp = fuck;
	}*/
	/*
	public void currentBlockPositionAddOne(Block bl){
		currentBlockPos=bl;
	}
	
	public void resetNextBlockPosition(){
		nextBlockPosition = nextBlockPosition - 39;
	}
	
	public void resetCurrentBlockPosition(){
		currentBlockPosition = -1;
	}
	*/
}
